/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package easyjetroster.controller;

import java.io.File;
import java.io.FileNotFoundException;
import javax.swing.JFileChooser;

/**
 *
 * @author Jappo
 */
public class Controller {

    public void parseRoster() throws FileNotFoundException{
        JFileChooser chooser = new JFileChooser();
        chooser.setFileFilter(new RosterFilter());

        int returnVal = chooser.showOpenDialog(null);

        if(returnVal == JFileChooser.APPROVE_OPTION) {
            File roster = chooser.getSelectedFile();
            System.out.println(roster.getAbsolutePath());

            RosterParser parser = new RosterParser();
            parser.parse(roster);
        }
        
    }

}
